﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Flight Reservation";
}

<div class="container">

    <div class="blog-header">
        <h1 class="blog-title">Aveiro Airlines Managment System</h1>
        <p class="lead blog-description">API Documentation - Flight Reservation</p>
    </div>

    <div class="row">

        <div class="col-sm-8 blog-main">

            <div class="blog-post">
                <h2 class="blog-post-title">About this section</h2>
                <p>
                    In this documentation you can find information about the methods that can be used to create a reservation to a flight.
                    At this point AAMS API supports one methods for flight reservations.
                </p>

                <section id="ReserveFlight">

                    <h2>Reserve a flight</h2>
                    <p>
                        Use the following method to create a flight reservation
                    </p>
                    <h3>URI</h3>
                    <pre><code>http://192.168.160.18/AveiroAirlines/api/Bookings/PostNewBooking</code></pre>
                    <h3>Method type</h3>
                    <pre><code>POST</code></pre>
                    <h3>Header parameters</h3>
                    <p>
                        Provide your API key token as a header parameter with the name "token".
                    </p>
                    <pre><code>"token"</code></pre>
                    <h3>URL Parameters</h3>
                    <p>
                        In order to create a reservation it is necessary to supply information about the flight id, a valid credit card number, the name of the client that is purchasing an seat and also a valid document number for the client (passport)
                    </p>
                    <pre><code>"FlightID" <br />"CreditCardNumber"<br />"ClientNameOnInvoice"<br />"ClientDocumentID"</code></pre>
                    <h3>Response type</h3>
                    <p>
                        If the reservation request is completed with success the method will return all the necessary information about the reservation, including it's id, invoice id and url.
                        <br />
                        if you are integrating this API with third party application then you should always save this information if you are making this reservations on behalf of external users to AAMS.
                    </p>
                    <pre><code>{
    "BookingID": "6cfea07f-0fa2-4202-b358-14bf6f7f9cc4",
    "FlightID": 2,
    "InvoiceID": "2A1AD865-789F-48CA-8EDE-46A7200BA1E0",
    "InvoiceURL": "www.fakeurl.com",
    "ClientNameonInvoice": "José Adelino Almeida Brazeta",
    "ClientDocumentID": "996566985475"
}</code></pre>

                    <h3>Example using <a href="https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm">POSTMAN</a></h3>
                    <p>
                        The following image is an example of a call to this API service using POSTMAN
                    </p>
                    <a href="~/POSTMAN-Flight-Reservation.PNG">
                        <img src="~/Images/POSTMAN-Flight-Reservation.PNG" class="img-thumbnail" alt="Responsive image" />
                    </a>


                </section>

                <hr>
            </div><!-- /.blog-post -->

            <ul class="pager">
                <li>@Html.ActionLink("Prev. - Flight Search", "", "FlightSearch")</li>
                <li>@Html.ActionLink("Next - Search a Reservation", "", "SearchReservation")</li>
            </ul>

        </div><!-- /.blog-main -->

        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
            <div class="sidebar-module sidebar-module-inset">
                <h4>About the authors</h4>
                <p>This page and all its content were developed by <em>José Brazeta</em>, <em>Luis Carta</em> and <em>João Martins</em> as an assignment for Advanced Web Programing (AEP), a course of the master degree in Information Systems at Aveiro University
            </div>
            <div class="sidebar-module">
                <h4>Other information:</h4>
                <ol class="list-unstyled">
                    <li><a href="#">AAMS Main Page</a></li>
                    <li><a href="#">Capsule CRM API</a></li>
                    <li><a href="#">Kashflow Main Page</a></li>
                </ol>
            </div>
            <div class="sidebar-module">
                <h4>Codeplex Repository</h4>
                <ol class="list-unstyled">
                    <li><a href="#">Get AAMS from Codeplex</a></li>
                </ol>
            </div>
        </div><!-- /.blog-sidebar -->

    </div><!-- /.row -->

</div>

